package com.minhua.jijiehao2.mainframe.circle.companyIdentifyActivity.impl

import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.http.*
import com.minhua.jijiehao2.mainframe.circle.companyIdentifyActivity.imp.CompanyIdentifyModel
import okhttp3.MultipartBody

class CompanyIdentifyModel : CompanyIdentifyModel {

    override fun uploadImage(multipart: MultipartBody.Part, callback: CallBack<String>) {
        HttpController<String>().doHttp(
                NoTokenApiClient.getInstance().api.uploadImage(multipart),
                object : BaseSubscriber<String>() {
                    override fun dealData(t: BaseBean<String>) {
                        super.dealData(t)
                        callback.onSuccess(t)
                    }
                },
                false
        )
    }


    override fun uploadCompanyInfo(map: ParamsMap, callBack: CallBack<String>) {
        HttpController<String>().doHttp(
                ApiClient.getInstance().api.uploadCompanyInfo(map.toRequestBody()),
                object : BaseSubscriber<String>() {
                    override fun dealData(t: BaseBean<String>) {
                        super.dealData(t)
                        callBack.onSuccess(t)
                    }
                }
        )
    }
}